namespace Pinwheel.LSerialize.Formatters
{
    [Preserve]
    public sealed unsafe class StringFormatter : LFormatter<string>
    {
        [Preserve]
        public override void Serialize(LSerializeContext* context, LStreamWriter* writer, ref string value)
        {
            Profiler.BeginSample("StringFormatter.Serialize");
            writer->WriteString(value);
            Profiler.EndSample();
        }

        [Preserve]
        public override void Deserialize(LSerializeContext* context, LStreamReader* reader, ref string value)
        {
            Profiler.BeginSample("StringFormatter.Deserialize");
            value = reader->ReadString();
            Profiler.EndSample();
        }
    } 
}

